<?php
session_start();
$url = "";
$lang = $_GET["lang"];

if(isset($_GET["url"])){
	// url parameter contains url without query string => need to restore the whole url (including query string)
	$url = $_SERVER['HTTP_REFERER'];//$_GET["url"];
	$_SESSION["lang"] = $lang;
	Header("Location: $url");
} else {
	Header("Location: ../pc/index.php");
}
?>